import pygame
from point import Point
    
class Shot:
    image = None
    point = None
    
    def __init__(self, point = Point() ):    
        self.image = pygame.image.load('fireball.png').convert()
        self.image.set_colorkey(self.image.get_at((0,0)))
        self.point = point

    def paint(self,screen):
        image_to_paint = pygame.transform.rotate(self.image,self.point.angle)
        screen.blit( image_to_paint, (self.point.x, self.point.y))
        
    def move(self):
        self.point.move()
        
    def is_in_screen(self):
        return self.point.is_in_screen()
    
    def get_rect(self):
        return pygame.Rect(self.point.x, self.point.y, self.image.get_rect().width, self.image.get_rect().height)
    
    def collides(self,asteroid):
        self.get_rect()
        asteroid.get_rect()
        return self.get_rect().colliderect( asteroid.get_rect()) 
        
if __name__ == "__main__":
    pygame.init()
    screen = pygame.display.set_mode( (100,200) )
    Shot().get_rect()